package com.zbb.exam_system.task;

import com.alibaba.fastjson.JSON;
import com.zbb.exam_system.bean.JwtOperation;
import com.zbb.exam_system.dto.UserDto;
import com.zbb.template.MyRedisTemplate;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import static com.zbb.exam_system.constant.BusinessConstant.LOGIN_COUNT;

@Slf4j
public class LoginTask implements Job {

    @Override
    public void execute(JobExecutionContext ctx) throws JobExecutionException {

        MyRedisTemplate myRedisTemplate = new MyRedisTemplate();
        myRedisTemplate.del(LOGIN_COUNT);
        log.info("每30分钟执行一次，将Redis中储存的登录超过指定次数的键删除");
    }
}
